<?php

namespace App\Http\Controllers\Api;


use App\OnlineFilmticket;
use Illuminate\Http\Request;

class OnlineFilmTicketController extends BaseController
{
    public $user;
    //
    public function __construct(Request $request)
    {
        parent::__construct();
        $this->user = $this->is_login($request);
    }


    /**
     * @param Request $request
     * 查询网售已绑定影院列表
     */
    public function index(Request $request){

        $user_id = 2;
        $list = OnlineFilmticket::where('online_user_id','=',$user_id)
            ->where('cinemas.status','!=',3)
            ->join('cinemas','cinemas.code','=','online_filmtickets.cinema_code')
            ->select('online_filmtickets.*','cinemas.name')
            ->paginate(15);
        return success($list,'查询成功');
    }



}
